<?php
		mysql_data_seek($forms_info, 0);
		/*echo "<pre>";
			print_r($forms_info);
		echo "</pre>";*/
		
		//$external_only = $forms_info;
		/*while($crap = sqlFetchArray($external_only)){
			echo "<pre>";
			print_r($crap);
		echo "</pre>";
		}*/
		
		$ext1 = '';
		$ext2 = '';
		$ext3 = '';
		$ext4 = '';
		
		function create_external($value){
			global $forms_info, $ext1, $ext2, $ext3, $ext4;
			$ext1 = "<td><select type='text' id='1_extocular_1' name='1_extocular_1'>".
					"	<option value='1' text='". xl('Normal') ."'>".
							xl('Normal') .
					"	</option>".
					"	<option value='2' text='". xl('Abnormal')."'>".
							 xl('Abnormal') .
					"	</option>".
					"</select></td>";
			$ext2 = "<td><select type='text' id='1_extocular_2' name='1_extocular_2'>".
					"	<option value='1' text='". xl('Normal') ."'>".
							xl('Normal') .
					"	</option>".
					"	<option value='2' text='". xl('Abnormal')."'>".
							 xl('Abnormal') .
					"	</option>".
					"</select></td>";
			$ext3 = "<td><select type='text' id='1_extocular_3' name='1_extocular_3'>".
					"	<option value='1' text='". xl('Normal') ."'>".
							xl('Normal') .
					"	</option>".
					"	<option value='2' text='". xl('Abnormal')."'>".
							 xl('Abnormal') .
					"	</option>".
					"</select></td>";
			$ext4 = "<td><select type='text' id='1_extocular_4' name='1_extocular_4'>".
					"	<option value='1' text='". xl('Normal') ."'>".
							xl('Normal') .
					"	</option>".
					"	<option value='2' text='". xl('Abnormal')."'>".
							 xl('Abnormal') .
					"	</option>".
					"</select></td>";
			
			$number = 2;
			while($row = sqlFetchArray($forms_info)){
				$ext1 .= "<td><select type='text' id='".$number."_extocular_1' name='".$number."_extocular_1'>".
						"	<option value='1' text='". xl('Normal') ."' ". selected(1, $row['eyelids']) ." >".
								xl('Normal') .
						"	</option>".
						"	<option value='2' text='". xl('Abnormal')."' ". selected(2, $row['eyelids']) ." >".
								 xl('Abnormal') .
						"	</option>".
						"</select></td>";
				$ext2 .= "<td><select type='text' id='".$number."_extocular_2' name='".$number."_extocular_2'>".
						"	<option value='1' text='". xl('Normal') ."' ". selected(1, $row['eyelashes']) ." >".
								xl('Normal') .
						"	</option>".
						"	<option value='2' text='". xl('Abnormal')."' ". selected(2, $row['eyelashes']) ." >".
								 xl('Abnormal') .
						"	</option>".
						"</select></td>";
				$ext3 .= "<td><select type='text' id='".$number."_extocular_3' name='".$number."_extocular_3'>".
						"	<option value='1' text='". xl('Normal') ."' ". selected(1, $row['conjunctiva']) ." >".
								xl('Normal') .
						"	</option>".
						"	<option value='2' text='". xl('Abnormal')."' ". selected(2, $row['conjunctiva']) ." >".
								 xl('Abnormal') .
						"	</option>".
						"</select></td>";
				$ext4 .= "<td><select type='text' id='".$number."_extocular_4' name='".$number."_extocular_4'>".
						"	<option value='1' text='". xl('Normal') ."' ". selected(1, $row['sclera']) ." >".
								xl('Normal') .
						"	</option>".
						"	<option value='2' text='". xl('Abnormal')."' ". selected(2, $row['sclera']) ." >".
								 xl('Abnormal') .
						"	</option>".
						"</select></td>";
				$number += 1;
			}
		}
		
		create_external(0);
		
		

		



?>
        <table class="vertical_table" id='t_external_ocular_exam'>
            <caption><?php echo xl('External Ocular Exam (Treatment eye only)');?></caption>
            <thead>
                <tr>
                    <th colspan="3">1. <?php echo xl('Eyelids'); ?>:</th>
                </tr>
				<tr>
                    <th colspan="3">2. <?php echo xl('Eyelashes'); ?>:</th>
                </tr>
				<tr>
                    <th colspan="3">3. <?php echo xl('Conjunctiva'); ?>:</th>
                </tr>
				<tr>
                    <th colspan="3">4. <?php echo xl('Sclera'); ?>:</th>
                </tr>
            </thead>
            <tbody>
				<tr>
					<?php echo $ext1;?>		
				</tr>
				<tr>
					<?php echo $ext2;?>					
				</tr>
				<tr>
					<?php echo $ext3;?>					
				</tr>
				<tr>
					<?php echo $ext4;?>						
				</tr>
            </tbody>
        </table>